/*
 * EasyBounceRankContainer.h
 *
 *  Created on: 2009-3-14
 *      Author: Wayne
 */

#ifndef EASYBOUNCERANKCONTAINER_H_
#define EASYBOUNCERANKCONTAINER_H_

// INCLUDES
#include <coecntrl.h>
#include <aknlists.h>
#include "coedef.h"
#include "eiklbx.h"         // For Listbox

// FORWARD DECLARATIONS
class CEasyBounceRankView;
class CEasyBounceRankList;

/**
*  container control class.
*  
*/
class CEasyBounceRankContainer : public CCoeControl, MCoeControlObserver
    {
    public: //
        
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect);
        
        /**
        * Constructor.
        */
        CEasyBounceRankContainer(CEasyBounceRankView* aView);

        /**
        * Destructor.
        */
        ~CEasyBounceRankContainer();
        
        /*!
          @function OfferKeyEventL

          @discussion Handles key events.
          @param aKeyEvent The key event.
          @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.
          @result Indicates whether or not the key event was used by this control.
          */
         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
         
         /**
         * Delete a record.
         */
         void DeleteItemFromRank();

    private: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        void Draw(const TRect& aRect) const;

       /**
        * From CCoeControl, HandleControlEventL.
        */
        // event handling section
        // e.g Listbox events
        void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
        
    public: // new functions
    	void RankListTest();
    	CAknDoubleNumberStyleListBox* ListBox();
    	CEasyBounceRankList* RankList();
    
    private: // new functions
    	void InitListBox();

    private: //data
    	CEasyBounceRankView* iView;  // not own
    	
    	CAknDoubleNumberStyleListBox* iListBox;
    	
    	CEasyBounceRankList* iList;
    };

#endif /* EASYBOUNCERANKCONTAINER_H_ */
